package com.nancy.java_design.command.demo1;

import java.util.ArrayList;
import java.util.List;

public class client {
    public static void main(String[] args) {

        // 创建订单
        Order order = new Order();
        order.setDiningTableId(1);
        order.setDishes("西红柿蛋炒饭", 1);
        order.setDishes("百事可乐", 2);

        Order order2 = new Order();
        order2.setDiningTableId(3);
        order2.setDishes("牛肉拉面", 2);
        order2.setDishes("刀切羊肉", 1);

        // 创建厨师
        Chef chef = new Chef();
        OrderCommand orderCommand = new OrderCommand(chef, order);
        OrderCommand orderCommand2 = new OrderCommand(chef, order2);

        // 封装命令
        List<Command> commands = new ArrayList<>();
        commands.add(orderCommand);
        commands.add(orderCommand2);

        // 创建服务员,执行命令
        Waiter waiter = new Waiter();
        waiter.setCommands(commands);
        waiter.notifyAllCommand();

    }
}
